LTE/5G
Package: system
Optional lte-mipsbe.npk is only required for SXT 3-7 built-in modem.
Support for Direct-IP mode type cards only. MBIM support is available in RouterOS v7 releases and the MBIM driver is loaded automatically. If the modem is not recognized in RouterOS v6. Please test it in v7 releases before asking for support in RouterOS v6.
To enable access via a PPP interface instead of an LTE Interface, change the operational mode to "serial" with /interface/lte/settings/set mode=serial CLI command and issue a reboot. Note that using PPP emulation mode you may not get the same throughput speeds as using the LTE interface emulation type.
For RouterOS v7 the ignore-direct-modem parameter was renamed to mode and moved to /interface/lte/settings menu.
LTE Client
Sub-menu: /interface/lte
Properties
| Property | Description |
|---|---|
| allow-roaming (yes | no; Default: no) | Enable data roaming for connecting to other countries' data-providers. Not all LTE modems support this feature. Some modems, that do not fully support this feature, will connect to the network but will not establish an IP data connection with allow-roaming set to no. |
| apn-profiles (string; Default: default) | Which APN profile to use for this interface |
| band (integer list; Default: "") | LTE Frequency band used in communication LTE Bands and bandwidths |
| nr-band (integer list; Default: "") | 5G NR Frequency band used in communication 5G NR Bands and bandwidths |
| comment (string; Default: "") | Descriptive name of an item |
| disabled (yes | no; Default: no) | Whether the interface is disabled or not. By default it is enabled. |
| modem-init (string; Default: "") | Modem init string (AT command that will be executed at modem startup) |
| mtu (integer || auto; Default: 1500) | Maximum Transmission Unit. Max packet size that the LTE interface will be able to send without packet fragmentation.
|
| name (string; Default: "") | Descriptive name of the interface. |
| network-mode (3g | gsm | lte | 5g) | Select/force mode for LTE interface to operate with |
| operator (integer; Default: "") | Used to lock the device to a specific operator. The full PLMN number is used for the lock consisting of MCC+MNC. PLMN codes |
| pin (integer; Default: "") sensitive | SIM Card's PIN code. |
| sms-protocol(at | auto | mbim) | SMS functionality. mbim: uses MBIM driver. at: uses AT-Commands. auto: selects the appropriate option depending on the modem. |
APN profiles
All network-related settings are under profiles
Sub-menu: /interface/lte/apn
| Property | Description |
|---|---|
| add-default-route (yes | no) | Whether to add a default route to forward all traffic over the LTE interface. |
| apn (string) | Service Provider's Access Point Name |
| authentication (pap | chap | none; Default: none) | Allowed protocol to use for authentication |
| default-route-distance (integer; Default: 2) | Sets distance value applied to auto-created default route, if add-default-route is also selected. The LTE route by default has distance 2 to prefer wired routes over LTE |
| ip-type (auto | ipv4 | ipv4-ipv6 | ipv6; Default:auto ) | Requested PDN type |
| ipv6-interface (; Default: ) | Interface on which to advertise IPv6 prefix |
| name (string; Default: ) | APN profile name |
| number (integer; Default: ) | APN profile number |
| passthrough-interface (; Default: ) | Interface to passthrough IP configuration (activates passthrough) |
| passthrough-mac (MAC; Default: auto) | If set to auto, then it will learn the MAC from the first packet |
| passthrough-subnet-selection (auto / p2p; Default: auto) | "auto" selects the smallest possible subnet to be used for the passthrough interface. "p2p" sets the passthrough interface subnet as /32 and picks the gateway address from the 10.177.0.0/16 range. The gateway address stays the same until the apn configuration is changed. |
| password (string; Default: ) sensitive | Password used if any of the authentication protocols are active |
| use-network-apn (yes | no; Default: yes) | Parameter is available starting from RouterOS v7 and used only for MBIM modems. If set to yes, uses the network provided APN. |
| use-peer-dns (yes | no; Default: yes) | If set to yes, uses the DNS received from the LTE interface |
| user (integer) | Username used if any of the authentication protocols are active |
LTE settings
LTE and router-specific LTE settings. The menu is available starting from RouterOS v7.
Sub-menu: /interface/lte/settings
| Property | Description |
|---|---|
| mode (auto | mbim | serial / user; Default: auto) | Operation mode setting.
|
| firmware-path (string) | Firmware path in host OS. Modem gobi firmware |
| external-antenna (auto | both | div | main | none; Default: auto) | This setting is only available for "Chateau" routers, except for Chateau 5G versions.
|
| external-antenna-selected () | This setting is only available for "Chateau" routers, except for Chateau 5G versions. Shows the currently selected antenna if "external-antenna" is set to "auto" |
| sim-slot () | This setting is available for routers that have switchable SIM slots (LtAP, SXT). Selection options differ between products. |
| esim-channel (auto | at; Default: auto) | Control channel to use for esim management |
| link-recovery-timer (integer Default: 120 Range: 120..4294967295) | Time in seconds after which the lte interface will be reconfigured if it does not get to (R)running state |
LTE eSIM
RouterOS version: 7.18+
MikroTips: How to activate your eSIM for the first time!
This menu contains commands related to eSIM (embedded Subscriber Identification Module) provisioning and management using RouterOS built-in LPA (eSIM Local Profile Assistant).
A single eSIM chip can store multiple eSIM profiles, the maximum profile count depends on the eSIM chip used.
RouterOS LPA supports:
- AT modems whose firmware supports SIM low access commands (AT+CCHO; AT+CCHC; AT+CGLA).
- MBIM modems which support SIM low level access service in its firmware (UUID_SERVICE_MS_UICC).
Other requirements:
- eSIM in SIM card form factor (physical eSIM) inserted in the RouterBoard SIM slot.
- eSIM/eUICC is present on the modem (soldered chip) and the modem is set to use this slot.
- Connectivity to eSIM SIM profile provider SM-DP+ provisioning server during provisioning and deletion of SIM profiles on the eSIM chip (for connectivity, you can use another eSIM profile or another WAN interface).
- eSIM can be provisioned only if the active slot is eSIM.
- Some devices have multiple SIM slots, and to use an eSIM, you need to switch the slot using the command "/interface/lte/settings/set sim-slot=esim".
The command /interface/lte/esim/esim-id [find /interface/lte] can be used to check whether the modem supports SIM low access commands and eSIM presence.
If a 3rd party modem with embedded eSIM chip is used, please consult the modem manual regarding AT commands needed to select the eSIM slot (AT!UIMS; AT+QUIMSLOT etc).
Commands
| Property | Description |
|---|---|
| deactivate | Deactivate (disable) eSIM profile. /interface/lte/esim/deactivate number=0 |
| activate | Activate (enable) eSIM profile. /interface/lte/esim/activate number=0 |
| delete | Permanently delete eSIM profile from the eSIM card. /interface/lte/esim/delete number=0 |
List the eSIM profiles installed on the eSIM /interface/lte/esim/print | |
| provision | Provision new eSIM profile. The command takes four parameters:
/interface/lte/esim/provision interface=lte1 sm-dp-plus=server.example.io matching-id=ABCD10EFGHI5KL6M |
| esim-id | Query the eSIM ID. The command takes one parameter:
/interface/lte/esim/esim-id interface=lte1 eid: 8903302342630000000004181FFFFFFF |
| set-nickname | Set a nickname for an eSIM profile. /interface/lte/esim/set-nickname number=0 nickname=nickname1 |
| refresh-profile-list | Re-query the eSIM profile list. The command takes one parameter:
|
Devices with built in eSIM chip (MikroTik Connectivity)
These devices have pre-loaded MikroTik Connectivity eSIM profiles. https://mikrotik.com/connectivity
| Device Model | Modem |
|---|---|
| S53UG+5HaxD2HaxD-TC&RG650E-EU | RG650E-EU |
| ATLGM&RG520F-EU | RG520F-EU |
| EC25-EU&KNe | EC25-EU |
Modem eSIM management support table
* These modems do not have eSIM built in. They require an external eSIM chip. For example, a physical eSIM card (eSIM in a standard SIM form factor).
| Modem | Support | Comment |
|---|---|---|
| EC200A-EU | yes* | |
| EG06-A | yes* | |
| EG18-EA | yes* | |
| EG12-EA | yes* | |
| EG120K-EA | yes* | |
| RG520F-EU | yes* | |
| EP06-A | yes* | |
| RG502Q-EA | yes* | |
| FG621-EA | yes* | Can't manage empty eSIM (no profiles) |
| R11e-LTE6 | yes* | Starting from firmware revision R11e-LTE6_V039 |
| R11e-LTE-US | no | |
| R11e-4G | no | |
| R11e-LTE | no |
Scanner
It is possible to scan LTE interfaces with /interface/lte/scan command. Example:
[admin@MikroTik] > /interface/lte/scan duration=60 number=0
Columns: OPERATOR, MCC-MNC, RSSI, RSRP, RSRQ
OPERATOR MCC-MNC RSSI RSRP RSRQ
LMT 24701 -36dBm -63dBm -7dB
Available properties:
| Property | Description |
|---|---|
| duration (integer) | Duration of scan in seconds |
| freeze-frame-interval (integer) | Time between data printout |
| number (integer) | Interface number or name |
User Info command
It is possible to send a special "info" command to the LTE interface with the /interface/lte/info command. In RouterOS v7 this command is moved to the /interface/lte/monitor menu.
Properties (Up to 6.40)
| Property | Description |
|---|---|
| user-command (string; Default: "") | sends a command to the LTE card to extract useful information, e.g. with AT commands |
| user-command-only (yes | no; Default: ) |
Modem firmware-upgrade command
The command allows to check and upgrade modem firmware if an update is available for supported MikroTik modems.
For firmware update availability check and installation, an active internet connection is required, depending on the modem internet connection can be provided using any RouterOS interface or modem interface (FOTA), please see table below regarding each modem's supported connection methods.
| Arguments / Properties | Description |
|---|---|
| upgrade (yes | no; Default: no) | Set command execution mode:
|
| update-channel (stable | testing; Default: stable) | Sets which firmware update channel is used:
|
| firmware-file (string; Default:"" ) | Allows the user to override firmware update source and perform an upgrade from a custom location (file, url) in environments where upgrade using an internet connection to MikroTik upgrade servers is not a viable option, eg private networks etc. |
Before attempting an LTE modem firmware upgrade - upgrade RouterOS version to the latest release How To Upgrade RouterOS
Modems with firmware update support and connectivity required
Use command /interface/lte/monitor [find] once to get the returned property "model" for installed modem model identification.
| Modem | Required connectivity to MikroTik upgrade servers |
|---|---|
| EC200A-EU R11eL-EC200A-EU | Using the modem LTE interface Using any RouterOS interface (7.18beta1+) |
| EG06-A | Using any RouterOS interface |
| EP06-A | Using any RouterOS interface |
| EG12-EA | Using any RouterOS interface |
| EG18-EA | Using any RouterOS interface |
| FG621-EA R11eL-FG621-EA | Using any RouterOS interface |
| R11-LTE | Using the modem LTE interface |
| R11e-4G | Using any RouterOS interface |
| R11e-LTE6 | Using any RouterOS interface |
| RG502Q-EA | Using any RouterOS interface |
| RG520F-EU | Using any RouterOS interface |
Modem firmware-upgrade command examples:
Check for new firmware update availability
[admin@D53G] > /interface/lte/firmware-upgrade lte1
installed: EG12EAPAR01A13M4G_02.001.02.001
latest: EG12EAPAR01A15M4G_01.201.01.201
Check for new firmware update availability in the early access/testing channel
[admin@D53G] > /interface/lte/firmware-upgrade lte1 update-channel=testing
installed: EG12EAPAR01A15M4G_01.201.01.201
latest: EG12EAPAR01A15M4G_01.203.01.203
Install the latest firmware
[admin@D53G] > /interface/lte/firmware-upgrade lte1 upgrade=yes
Install the latest firmware from the early access/testing channel
[admin@D53G] > /interface/lte/firmware-upgrade lte1 upgrade=yes update-channel=testing
User at-chat command
It is possible to send a user-defined "at-chat" command to the LTE interface with the /interface/lte/at-chat command.
[admin@MikroTik] > /interface/lte/at-chat lte1 input="AT"
output: OK
It is also possible to use the "wait" parameter wait=yes with the command to make "at-chat" wait for 5 seconds and return all the output instead of returning only the first received data. This is useful for some commands that return multiline output or a large block of data.
[admin@MikroTik] > /interface/lte/at-chat lte1 input="at+qcfg=?"
output:
[admin@MikroTik] > /interface/lte/at-chat lte1 input="at+qcfg=?" wait=yes
output: +QCFG: "rrc",(0-5)
+QCFG: "hsdpacat",(6,8,10-24)
+QCFG: "hsupacat",(5,6)
+QCFG: "pdp/duplicatechk",(0,1)
+QCFG: "risignaltype",("respective","physical")
+QCFG: "lte/bandprior",(1-43),(1-43),(1-43)
+QCFG: "volte_disable",(0,1)
+QCFG: "diversity/config",(4,6),(1-4),(0)
+QCFG: "div_test_mode",(0,1)
+QCFG: "usbspeed",("20","30")
+QCFG: "data_interface",(0,1),(0,1)
+QCFG: "pcie/mode",(0,1)
+QCFG: "pcie_mbim",(0,1)
+QCFG: "sms_control",(0,1),(0,1)
+QCFG: "call_control",(0,1),(0,1)
+QCFG: "usb/maxpower",(0-900)
+QCFG: "efratctl",(0,1)
+QCFG: "netmaskset",(0,1)[,<netmask>]
+QCFG: "mmwave",ant_chip,ant_type
+QCFG: "gatewayset",(0,1)[,<gateway>]
+QCFG: "clat",(0,1),(0,1),<prefix>,(0,32,40,48,56,64,96),<fqdn>,(0,1),(0,1,2,4,8),(0,1),(0,1),(0,1,2),(0,1,2)
+QCFG: "usage/apmem"
+QCFG: "enable_gea1"[,(0,1)]
+QCFG: "dhcppktfltr",(0,1)
OK
You can also use the "at-chat" function in scripts and assign command output to a variable.
[admin@MikroTik] > :global "lte_command" [/interface/lte/at-chat lte1 input="AT+CEREG?" as-value ]
[admin@MikroTik] > :put $"lte_command"
output=+CEREG: 0,1
OK
Quick setup example
Start with network settings - Add new connection parameters under the LTE apn profile (provided by the network provider):
/interface/lte/apn/add name=profile1 apn=phoneprovider.net authentication=chap password=web user=web
Select the newly created profile for an LTE connection:
/interface/lte/set [find] apn-profiles=profile1
The LTE interface should appear with the running (R) flag:
[admin@MikroTik] > /interface/lte/print
Flags: X - disabled, R - running
0 R name="lte1" mtu=1500 mac-address=AA:AA:AA:AA:AA:AA
If required, add NAT Masquerade for LTE Interface to get internet to the local network:
/ip/firewall/nat/add action=masquerade chain=srcnat out-interface=lte1
After the interface is added, you can use the "info" command to see what parameters the client acquired (parameters returned depend on the LTE hardware device):
[admin@MikroTik] > /interface/lte/monitor lte1
status: connected
model: EG18-EA
revision: EG18EAPAR01A12M4G
current-operator: LMT
current-cellid: 3103242
enb-id: 12122
sector-id: 10
phy-cellid: 480
data-class: LTE
session-uptime: 15m54s
imei: 86981604098XXXX
imsi: 24701060267XXXX
iccid: 8937101122102057XXXX
primary-band: B3@20Mhz earfcn: 1300 phy-cellid: 480
dl-modulation: qpsk
cqi: 7
ri: 2
mcs: 1
rssi: -68dBm
rsrp: -97dBm
rsrq: -9dB
sinr: 6dB
Passthrough Example
Some LTE interfaces support the LTE Passthrough feature where the IP configuration is applied directly to the client device. In this case, modem firmware is responsible for the IP configuration, and the router is used only to configure modem settings - APN, Network Technologies, and IP-Type. In this configuration, the router will not get IP configuration from the modem. The LTE Passthrough modem can pass both IPv4 and IPv6 addresses if that is supported by the modem. Some modems support multiple APNs where you can pass the traffic from each APN to a specific router interface.
Passthrough will only work for one host. The router will automatically detect the MAC address of the first received packet and use it for the Passthrough. If there are multiple hosts on the network it is possible to lock the Passthrough to a specific MAC. On the host on the network where the Passthrough is providing the IP a DHCP-Client should be enabled on that interface too. Note that it will not be possible to connect to the LTE router via a public lte IP address or from the host which is used by the passthrough. It is suggested to create an additional connection from the LTE router to the host for configuration purposes. For example, a vlan interface between the LTE router and host.
To enable Passthrough a new entry is required or the default entry should be changed in the /interface/lte/apn menu
Passthrough is not supported by all chipsets. To check if your modem supports passthrough:
/interface/lte/show-capabilities [find]
Examples
To configure Passthrough on ether1:
[admin@MikroTik] > /interface/lte/apn/add apn=apn1 passthrough-interface=ether1
[admin@MikroTik] > /interface/lte/set lte1 apn-profiles=apn1
To configure the Passthrough on ether1 host 00:0C:42:03:06:AB:
[admin@MikroTik] > /interface/lte/apn/add apn=apn1 passthrough-interface=ether1 passthrough-mac=00:0C:42:03:06:AB
[admin@MikroTik] > /interface/lte/set lte1 apn-profiles=apn1
To configure multiple APNs on ether1 and ether2:
[admin@MikroTik] > /interface/lte/apn/add apn=apn1 passthrough-interface=ether1
[admin@MikroTik] > /interface/lte/apn/add apn=apn2 passthrough-interface=ether2
[admin@MikroTik] > /interface/lte/set lte1 apn-profiles=apn1,apn2
To configure multiple APNs with the same APN for different interfaces:
[admin@MikroTik] > /interface/lte/apn/add name=interface1 apn=apn1
[admin@MikroTik] > /interface/lte/apn/add name=interface2 apn=apn1 passthrough-interface=ether1
[admin@MikroTik] > /interface/lte/set lte1 apn-profiles=interface1
[admin@MikroTik] > /interface/lte/set lte2 apn-profiles=interface2
Additionally, you can override the default dynamic dhcp server parameters/options by creating a DHCP server manually on the same passthrough-interface. For example, the default lease-time is 1 minute:
[admin@MikroTik] > /ip/dhcp-server/print detail
Flags: D - dynamic; X - disabled, I - invalid
0 D name="apn2" interface=ether2 lease-time=1m address-pool=static-only use-radius=no lease-script="" address-lists=""
Now if you want to change the lease-time to, for example, 30 minutes, then you can create a new dhcp-server on the passthrough-interface, in this case, ether2:
[admin@MikroTik] > /ip/dhcp-server/add interface=ether2 name=dhcp1 lease-time=30m
[admin@MikroTik] > /ip/dhcp-server/print detail
Flags: D - dynamic; X - disabled, I - invalid
0 name="dhcp1" interface=ether2 lease-time=30m address-pool=static-only use-radius=no lease-script="" address-lists=""
Dual SIM
Boards with switchable SIM slots
| RouterBoard | Modem slot | SIM slots | Switchable |
|---|---|---|---|
| LtAP | lower | 2 | 3 |
| upper | 1 | N | |
| LtAP mini | up | down | |
| SXT R | a | b | |
| ATL 5G | sim | esim |
SIM slots switching commands
- RouterOS v7
/interface/lte/settings/set sim-slot=down
- RouterOS v6 after 6.45.1
/system/routerboard/modem/set sim-slot=down
- RouterOS v6 pre 6.45.1:
/system/routerboard/sim/set sim-slot=down
For more reference please see the board block diagram, Quick Guide, and User manual.
Usage Example
Follow this link - Dual SIM Application, to see examples of how to change the SIM slot based on the roaming status and in case the interface status is down, with the help of RouterOS scripts and scheduler.
Tips and Tricks
This paragraph contains information for additional features and usage cases.
Find device location using Cell information
On devices using the R11e-LTE International version card (wAP LTE kit), some extra information is provided under info command.
current-operator: 24701
lac: 40
current-cellid: 2514442
| Property | Description |
|---|---|
| current-operator (integer; Default: ) | Contains MCC and MNC. For example: current-operator: 24701 breaks to: MCC=247 MNC=01 |
| lac (integer; Default: ) | Location area code (LAC) |
| current-cellid (integer; Default: ) | Station identification number |
Values can be used to find location in databases: Cell Mapper
Using Cell lock
It is possible to lock R11e-LTE, R11e-LTE6 and R11e-4G modems and equipped devices to the exact LTE tower. The LTE info command provides currently used cellular tower information:
phy-cellid: 384
earfcn: 1300 (band 3, bandwidth 20Mhz)
| Property | Description |
|---|---|
| phy-cellid (integer; Default: ) | Physical Cell Identification (PCI) of currently used cell tower. |
| earfcn (integer; Default: ) | Absolute Radio Frequency Channel Number |
The exact tower location as well as available bands and other information can be acquired from the mobile carrier or by using online services:
By using those acquired variables it's possible to send the AT command to the modem for locking to the tower in the current format:
for R11e-LTE and R11e-LTE6
AT*Cell=<mode>,<NetworkMode>,<band>,<EARFCN>,<PCI>
where
<mode> :
0 – Cell/Frequency disabled
1 – Frequency lock enabled
2 – Cell lock enabled
<NetworkMode>
0 – GSM
1 – UMTS_TD
2 – UMTS_WB
3 – LTE
<band>
Not in use, leave this blank
<EARFCN>
earfcn from lte info
<PCI>
phy-cellid from lte info
To lock the modem at the previously used tower, at-chat can be used:
/interface/lte/at-chat lte1 input="AT*Cell=2,3,,1300,384"
For R11e-LTE all set locks are lost after reboot or modem reset. Cell data can also be gathered from "cell-monitor".
For R11e-LTE6 cell lock works only for the primary band. This can be useful if you have multiple channels on the same band and you want to lock it to a specific earfcn. Note that cell lock is not band-specific and for ca-band it can also use other frequency bands, unless you use band lock.
Use cell lock to set the primary band to the 1300 earfcn and use the second channel for the ca-band:
/interface/lte/at-chat lte1 input="AT*Cell=2,3,,1300,138"
Now it uses the earfcn: 1300 for the primary channel:
primary-band: B3@20Mhz earfcn: 1300 phy-cellid: 138
ca-band: B3@5Mhz earfcn: 1417 phy-cellid: 138
You can also set it the other way around:
/interface/lte/at-chat lte1 input="AT*Cell=2,3,,1417,138"
Now it uses the earfcn: 1417 for the primary channel:
primary-band: B3@5Mhz earfcn: 1417 phy-cellid: 138
ca-band: B3@20Mhz earfcn: 1300 phy-cellid: 138
For the R11e-LTE6 modem, cell lock information will not be lost after reboot or modem reset. To remove the cell lock, use the at-chat command:
/interface/lte/at-chat lte1 input="AT*Cell=0"
for R11e-4G
AT%CLCMD=<mode>,<mode2>,<EARFCN>,<PCI>,<PLMN>
AT%CLCMD=1,1,3250,244,\"24705\"
where
<mode> :
0 – Cell/Frequency disabled
1 – Cell lock enabled
<mode2> :
0 - Save lock for first scan
1 - Always use lock
(after each reset modem will clear out previous settings no matter what is used here)
<EARFCN>
earfcn from lte info
<PCI>
phy-cellid from lte info
<PLMN>
Mobile operator code
All PLMN codes available here. This variable can be also left blank
To lock the modem to the cell - the modem needs to be in a non-operating state, the easiest way for the R11e-4G modem is to add a CellLock line to the "modem-init" string:
/interface/lte/set lte1 modem-init="AT%CLCMD=1,1,3250,244,\"24705\""
Multiple cells can also be added by providing a list instead of one tower's information in the following format:
AT%CLCMD=<mode>,<mode2>,<EARFCN_1>,<PCI_1>,<PLMN_1>,<EARFCN_2>,<PCI_2>,<PLMN_2>
For example to lock to two different PCIs within the same band and operator:
/interface/lte/set lte1 modem-init="AT%CLCMD=1,1,6300,384,\"24701\",6300,385,\"24701\""
for Chateau LTE12, Chateau LTE18, Chateau 5G, Chateau 5G R16, LHG LTE18, ATL LTE18, ATL 5G R16, Chateau 5G R17 ax
AT+QNWLOCK="common/4g",<num of cells>,[[<freq>,<pci>],...]
AT+QNWLOCK=\"common/4g\",1,6300,384
where
<num of cells>
number of cells to cell lock
<freq>
earfcn from lte info
<pci>
phy-cellid from lte info
Single-cell lock example:
/interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/4g\",1,3050,448"
Query current configuration:
/interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/4g\""
Multiple cells can also be added to the cell lock. For example to lock to two different cells:
/interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/4g\",2,3050,448,1574,474"
To remove the cell lock, use this at-chat command:
/interface/lte/at-chat lte1 input="at+qnwlock=\"common/4g\",0"
- Cell lock information will not be saved after a reboot or modem reset. 2. AT+QNWLOCK command can lock the cell and frequency. Therefore, the module can be given priority to register to the locked cell, however, according to the 3gpp protocol, the module will be redirected or handed over to a cell with better signal instructions, even if it is not within the lock of the command. This phenomenon is normal.
For the 5G-capable devices, it is also possible to lock the 5G SA cell
AT+QNWLOCK="common/5g",<pci>,<freq>,<scs>,<band>
AT+QNWLOCK=\"common/5g\",901,504990,30,41
where
<pci> String type. Cell physical ID. 0 indicates disabling locking module to the specified cell.
<freq> Integer type. Cell frequency (earfcn).
<scs> Integer type. NR sub carrier space. Unit: kHz. For FR1(Sub-6 GHz) FDD band, please set <scs> to 15; for FR1 TDD band, please set <scs> to 30. Otherwise, an error code may be returned.
15
30
<band> Integer type. NR5G frequency band.
Cell lock example to TDD n78 band with earfcn=628032 and phy-cellid=138:
/interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/5g\",138,628032,30,78"
Query the current configuration:
[admin@MikroTik] > /interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/5g\""
output: +QNWLOCK: "common/5g",138,628032,30,78
OK
To remove the cell lock use this at-chat command:
/interface/lte/at-chat lte1 input="AT+QNWLOCK=\"common/5g\",0"
-
Cell lock information will not be saved after a reboot or modem reset.
-
The AT+QNWLOCK command can lock the cell and frequency. Therefore, the module can be given priority to register to the locked cell, however, according to the 3gpp protocol, the module will be redirected or handed over to a cell with better signal instructions, even if it is not within the lock of the command. This phenomenon is normal.
-
When locking a cell, please make sure that the module supports the frequency band corresponding to the locked cell, otherwise an error code will be returned.
-
AT+QNWLOCK="common/5g" does not support locking 5G cells of NSA. (You can still lock to the lte anchor cell using the AT+QNWLOCK="common/4g" command.)
-
This Write Command can only be executed when the module is in full functionality (lte interface is not disabled).
-
This command is not recommended for commercial use.
for FG621-EA
AT+GTCELLLOCK=<mode>[,<rat>,<type>,<earfcn>[,<PCI>]]
where
< mode >: integer type; 0 Disable this function 1 Enable this function 2 Add new cell to be locked
<rat>: integer type; 0 LTE 1 WCDMA
<type>: integer type; 0 Lock PCI 1 Lock frequency
<earfcn>: integer type; the range is 0-65535.
<PCI>: integer type; If second parameter value is 0, the range is 0-503 for LTE If second parameter value is 1, the rang is 0-512 for WCDMA
Example:
/interface/lte/at-chat lte1 input="AT+GTCELLLOCK=1,0,0,6175,176"
Cell Monitor
Cell monitor allows scanning available nearby mobile network cells:
[admin@MikroTik] > /interface/lte/cell-monitor lte1
PHY-CELLID BAND PSC EARFCN RSRP RSRQ RSSI SINR
49 B20 6300 -110dBm -19.5dB
272 B20 6300 -116dBm -19.5dB
374 B20 6300 -108dBm -16dB
384 B1 150 -105dBm -13.5dB
384 B3 1300 -106dBm -12dB
384 B7 2850 -107dBm -11.5dB
432 B7 2850 -119dBm -19.5dB
Gathered data can be used for more precise location detection or for Cell lock.
Not all modems support this feature
Troubleshooting
Enable LTE logging
[admin@MikroTik] > /system/logging/add topics=lte
Check for errors in log
[admin@MikroTik] > /log/print
11:08:59 lte,async lte1: sent AT+CPIN?
11:08:59 lte,async lte1: rcvd +CME ERROR: 10
search for the CME error description online,
In this case: CME error 10 - SIM not inserted
Locking band on Huawei and other modems
To lock the band for Huawei modems, the /interface/lte/set lte1 band="" option can't be used.
It is possible to use AT commands to lock to the desired band manually.
To check all supported bands run the at-chat command:
[admin@MikroTik] /interface/lte/at-chat lte1 input="AT^SYSCFGEX=\?"
output: ^SYSCFGEX: ("00","03","02","01","99"),((2000004e80380,"GSM850/GSM900/GSM1800/GSM1900/WCDMA BCI/WCDMA BCII/WCDMA BCV/WCDMA BCVIII"),
(3fffffff,"All Bands")),(0-2),(0-4),((800d7,"LTE BC1/LTE BC2/LTE
BC3/LTE BC5/LTE BC7/LTE BC8/LTE BC20"),(7fffffffffffffff,"All Bands"))
OK
Example to lock to LTE band 7:
[admin@MikroTik] /interface/lte/set lte1 modem-init="AT^SYSCFGEX=\"03\",3FFFFFFF,2,4,40,,"
Change the last part 40 to the desired band specified hexadecimal value where:
4 LTE BC3
40 LTE BC7
80000 LTE BC20
7FFFFFFFFFFFFFFF All bands
etc
All band HEX values and AT commands can be found in Huawei AT Command Interface Specification guide
Check if the band is locked:
[admin@MikroTik] /interface/lte/at-chat lte1 input="AT^SYSCFGEX\?"
output: ^SYSCFGEX: "03",3FFFFFFF,0,2,40
OK
For more information check modem manufacturers' AT command reference manuals.
mPCIe modems with RB9xx series devices
In case your modem is not being recognized after a soft reboot, then you might need to add a delay before the USB port is initialized. This can be done using the following command:
/system/routerboard/settings/set init-delay=5s
Boards with USB-A port and mPCIe
Some devices such as specific RB9xx and the RBLtAP-2HnD share the same USB lines between a single mPCIe slot and a USB-A port. If auto switch is not taking place and a modem is not getting detected, you might need to switch manually to either use the USB-A or the mini-PCIe:
/system/routerboard/usb/set type=mini-PCIe
Avoiding tethering speed throttling
Some operators (TMobile, YOTA etc.) allow unlimited data only for the device the SIM card is used on, all other data coming from mobile hotspots or tethering is highly limited by volume or by throughput speed. Some sources have found out that this limitation is done by monitoring TTL (Time To Live) values from packets to determine if limitations need to be applied (TTL is decreased by 1 for each "hop" made). RouterOS allows changing the TTL parameter for packets going from the router to allow hiding subnetworks. Keep in mind that this may conflict with the fair use policy.
IPv4 :
/ip/firewall/mangle
add action=change-ttl chain=postrouting new-ttl=set:65 out-interface=lte1 passthrough=yes
IPv6 :
/ipv6/firewall/mangle
add action=change-hop-limit chain=postrouting new-hop-limit=set:65 passthrough=yes
More information: YOTA, TMobile
Unlocking SIM card after multiple wrong PIN code attempts
After locking the SIM card, unlocking can be done through "at-chat"
Check current PIN code status:
/interface/lte/at-chat lte1 input="at+cpin\?"
If the card is locked - unlock it by providing:
/interface/lte/at-chat lte1 input="AT+CPIN=\"PUK_code\",\"NEW_PIN\""
Replace PUK_code and NEW_PIN with matching values.
The command for sim slot selection changes in v6.45.1 and again in v7. Some device models like SXT have SIM slots named "a" and "b" instead of "up" and "down"